<?php require_once '../utils/securityUtils.php';

session_start();

$transID = SecurityUtils::RandNumberToken(4).time().SecurityUtils::RandNumberToken(6);
$_SESSION['transID'] = $transID;
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Color Manila Run - Register</title>
<link rel="stylesheet" href="../styles/layout.css" type="text/css" media="screen"/>
<script src="../scripts/jquery-1.8.2.js"></script>
<script src="../scripts/jquery.format.1.05.js"></script>
<script src="../scripts/preloadercontrol.js"></script>
<script src="../scripts/register.js"></script>
<script src="../scripts/textinputUtils.js"></script>
<script src="../scripts/inputTextMask.js"></script>
<script src="../scripts/commonUtils.js"></script>

</head>
<body marginheight="0" marginwidth="0">
<div id="preloader"><div><img src="../images/ajax-loader.gif" width="50" height="50"/></div></div>
<div id="regMainContainer">
	<div id="registerHeader">
		<div class="registerHeaderImg"><img src="../images/registration_header.png" alt="Registration"/></div>
		<div class="registerSteps">
			<div style="width:130px;">
				<div class="regStepIcon" style="padding-left:50px;"><img id="imgStep1" src="../images/reg_current_step.png" width="20" height="20"/></div>
			</div>
			<div style="width: 100px;">
				<div class="regStepIcon"><img id="imgStep2" src="../images/reg_next_step.png" width="20" height="20"/></div>
			</div>
			<div>
				<div class="regStepIcon"><img id="imgStep3" src="../images/reg_next_step.png" width="20" height="20"/></div>
			</div>
			<div>
				<div class="regStepIcon" ><img id="imgStep4" src="../images/reg_next_step.png" width="20" height="20"/></div>
			</div>
			<div>
				<div class="regStepIcon" ><img id="imgStep5" src="../images/reg_next_step.png" width="20" height="20"/></div>
			</div>
		</div>
		<div class="registerSteps">
			<div style="width:130px;">
				<div>&nbsp;&nbsp;Select Category</div>
			</div>
			<div style="width: 90px;">
				<div>&nbsp;&nbsp;Sign in</div>
			</div>
			<div style="width: 120px;">
				<div>Complete Form</div>
			</div>
			<div>
				<div>Review cart</div>
			</div>
			<div>
				<div>Check out</div>
			</div>
		</div>
	</div>
	<div id="registerContent"></div>
	<div class="divSpacer"></div>
	<div id="registerButtonMenu">
		<div id="registerButton">
			<div class="blue-buttonBL"></div>
			<div id="btnContinue" class="blue-buttonM">
			<a href="javascript:gotoRegistrationNextStep('register')">Continue</a>
			</div>
			<div class="blue-buttonBR"></div>
		</div>
		
		<div id="paypalPaymentDiv">
			<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
			<input type="hidden" name="cmd" value="_s-xclick">
			<input type="hidden" name="hosted_button_id" value="QJWJ6CN4VDSN4">
			<input type="hidden" name="quantity" value="<?php echo $runnerCnt?>">
			
			<input type="hidden" name="return" value="http://www.proactive.ph/colormanilarun/pages/returnregister.php?transID=<?php echo $transID;?>">
			<input type="hidden" name="rm" value="2">
			
			<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_paynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
			<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
			</form>
			
			<!-- form action="https://www.paypal.com/cgi-bin/webscr" method="post">
			<input type="hidden" name="cmd" value="_s-xclick">
			<input type="hidden" name="hosted_button_id" value="BKRAQTQM2NTCL">
			
			<input type="hidden" name="return" value="http://www.proactive.ph/colormanilarun/test/returnregister.php?transID=<?php echo $transID;?>">
			<input type="hidden" name="rm" value="2">
			
			<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_paynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
			<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
			</form-->
						
		</div>
			
	</div>
	<?php include 'footer.php'; ?>
</div>
</body>
<script>

$("#paypalPaymentDiv").hide();
//$("#paypalDiv").hide();
$("#preloader").css({ opacity: 0.5 });

$("#registerContent").click(function()
{
	$(".formInputAlphabet").keydown(restrictToAlphabet);
	$(".formInputAlphabet").bind('paste', restrictAlphabetOnPaste);

	$(".formInputNumbers").keydown(restrictToNumbers);
	$(".formInputNumbers").bind('paste', restrictNumericOnPaste);
	
	$(".formInputDate").mask("$9/&9/%999");
	$(".formInputDate").blur(function(e){
		validateDateMMDDYYYY(e,	$("#birthDateErrorMsg"));
	});
	
	$(".formInputEmail").blur(function(e){
		isValidEmail = false;
		validateEmailAddress(e, $("#emailErrorMsg"));
		if($("#emailErrorMsg").text() == '')
			validateEmail(false);
	});

	/*
	if(pageCtr == 4)
	{
		$("input[name=paymentMethod]:radio").change(function () {
			
			paramObj.payment_method = $("#registerContent").find( 'input[name="paymentMethod"]:checked' ).val();
			if(paramObj.payment_method == "PAYPAL")
			{
				$("#cashPaymentDiv").hide();
				showPaypalDiv(true);
			}
			else
			{
				showPaypalDiv(false);
				$("#cashPaymentDiv").show();
			}	
		});
	}
	*/
	
});

function paymentOptionClick()
{
	paramObj.payment_method = $("#registerContent").find( 'input[name="paymentMethod"]:checked' ).val();
	if(paramObj.payment_method == "PAYPAL")
	{
		$("#cashPaymentDiv").hide();
		showPaypalDiv(true);
	}
	else
	{
		showPaypalDiv(false);
		$("#cashPaymentDiv").show();
	}	
}

$.mask.definitions['$']='[01]';
$.mask.definitions['%']='[012]';
$.mask.definitions['&']='[0123]';

gotoRegistrationNextStep('register');

<?php 
	//setcookie("testCookie", "testCookie", time()+3600);
	
	if(isset($_SESSION['isRegistered']) && $_SESSION['isRegistered'] == true)
	{
		echo "isValidEmail=true";
	}
		
?>

</script>
</html>